#include <cstdio>
#include <cstring>
#include <math.h>

bool isPrime(int x){
    //偶数
    if(x % 2 == 0){
        return false;
    }
    //奇数
    for(int i = 3; i <= sqrt(x); i += 2){
        if(x % i == 0) return false;
    }
    return true;
}

int main()
{
    int N = 0, sum = 0;
    scanf("%d", &N);
    int s1 = 2, s2 = 3;
    for(int i = 5; i <= N; i++){
        if(!isPrime(i)){ continue; }
        s1 = s2;
        s2 = i;
        if(s2 - s1 == 2){ sum++; }
    }
    printf("%d\n", sum);
    return 0;
}
